import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'

import systemRouter from './system'
import goodsRouter from './goods'
import meetingRouter from './meeting'
import selfRouter from './self'

import adoptRouter from './adopt'
import adoptedRouter from "./adopted";
import appletRouter from './applet'
import semRouter from './sem'
import Index from "@/views/Index";
import Verification from "@/views/Verification";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta:{
      label: '重定向'
    },
    children: [
      {
        path: '/index',
        name: 'Index',
        component: Index,
        meta:{
          label: '首页'
        }
      },
      {
      path: '/verification',
      name: 'Verification',
      component: Verification,
      meta:{
        label: '核销取货码'
      }
    }].concat(systemRouter, meetingRouter,goodsRouter, selfRouter, adoptRouter, adoptedRouter, appletRouter, semRouter)
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
